Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored PR #949 and edited the comments/docstrings #952

Merged
merged 9 commits into from
Jul 27, 2021

Conversation

erezsh
Copy link
Member

@erezsh erezsh commented Jul 27, 2021

Also now only testing on LALR, to prevent needless compute and save the planet.

For reference (because removed from code):

REPEAT_BREAK_THRESHOLD:

# For a grammar  of the form start: "A"~0..N, these are the timing stats:
#  N  t
# 10 0.000
# 20 0.004
# 30 0.016
# 40 0.049
# 50 0.109
# 60 0.215
# 70 0.383
# 80 0.631

@erezsh erezsh requested a review from MegaIng July 27, 2021 08:47
Copy link
Member

@MegaIng MegaIng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were the tests really a performance problem for you? For me they ran a lot faster than as example the regex test.

tests/test_parser.py Outdated Show resolved Hide resolved
tests/test_parser.py Outdated Show resolved Hide resolved
@MegaIng
Copy link
Member

MegaIng commented Jul 27, 2021

BTW, if you want to run any of the performance tests for yourself, I uploaded my scripts into a repo

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2021

Codecov Report

Merging #952 (cf61f78) into master (87a18a0) will increase coverage by 0.10%.
The diff coverage is 97.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #952      +/-   ##
==========================================
+ Coverage   86.99%   87.10%   +0.10%     
==========================================
  Files          50       50              
  Lines        6723     6795      +72     
==========================================
+ Hits         5849     5919      +70     
- Misses        874      876       +2     
Flag Coverage Δ
unittests 87.10% <97.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lark/ast_utils.py 0.00% <ø> (ø)
lark/exceptions.py 85.29% <0.00%> (-0.64%) ⬇️
lark/lark.py 81.78% <ø> (ø)
lark/parsers/lalr_interactive_parser.py 78.46% <0.00%> (ø)
tests/test_parser.py 94.59% <ø> (-0.07%) ⬇️
lark/utils.py 83.40% <90.00%> (+0.30%) ⬆️
lark/load_grammar.py 92.07% <100.00%> (+0.44%) ⬆️
tests/test_grammar.py 98.29% <100.00%> (+0.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87a18a0...cf61f78. Read the comment docs.

@erezsh
Copy link
Member Author

erezsh commented Jul 27, 2021

Were the tests really a performance problem for you? For me they ran a lot faster than as example the regex test.

Well, it added almost 10 seconds, and now it takes 0.3 secs. It wasn't critical to remove, but I also think we should generally avoid long computations when they don't test anything.

@erezsh
Copy link
Member Author

erezsh commented Jul 27, 2021

Btw, what does you think about the coverage report? Useful or annoying?

@MegaIng
Copy link
Member

MegaIng commented Jul 27, 2021

In general good, but I am having a hard time interpreting them sometimes.

@erezsh erezsh merged commit 7ee1409 into master Jul 27, 2021
@erezsh erezsh deleted the MegaIng-better_repeats_refactor branch July 27, 2021 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants